package com.wondream.domain;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

/**
 * @author wondream
 * @version 1.0
 * @create 2022/5/15 10:23 PM
 */
@Data
@Document(collection = "article")
public class Article {

    @Id
    //使用Field建立实体类属性跟collection中字段的映射关系，如果省略，代表两者一致
    private Integer id;
    private String title;
    private String content;
    private String hits;
}
